#include <Ice/Ice.h>
#include <IceBox/IceBox.h>
#include <Mp3EncoderFactoryI.h>

using namespace std;

#ifndef MP3ENCODERSERVICE_SERVICE_API
#   define MP3ENCODERSERVICE_SERVICE_API ICE_DECLSPEC_EXPORT
#endif

class Mp3EncoderServiceI:
  public IceBox::Service
{
public:
  
  virtual void start(const string& name,
		     const Ice::CommunicatorPtr& communicator,
		     const Ice::StringSeq& args)
  {
    _adapter = communicator->
      createObjectAdapter(name + "-EncoderFactory");
    _adapter->add(new Mp3EncoderFactoryI,
		  communicator->stringToIdentity(name + "Mp3-Encoder"));
    _adapter->activate();
  }

  virtual void stop()
  {
    _adapter->deactivate();
  }

private:
  Ice::ObjectAdapterPtr _adapter;
};

extern "C"
{

MP3ENCODERSERVICE_SERVICE_API IceBox::Service*
create(Ice::CommunicatorPtr communicator)
{
    return new Mp3EncoderServiceI;
}

}

int main(int argc,
	 char* argv[])
{
  return 0;
}
